package core.controls;
import ibm.widgets.WComboBox;
import ibm.widgets.WStaticText;
import resources.core.controls.StaticTextHelper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.WPF.*;
import com.rational.test.ft.object.interfaces.dojo.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.object.interfaces.flex.*;
import com.rational.test.ft.object.interfaces.generichtmlsubdomain.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
import com.rational.test.util.regex.Regex;
import com.ibm.rational.test.ft.object.interfaces.sapwebportal.*;
/**
 * Description   : Functional Test Script
 * @author mariyana.hristova
 */
public class StaticText extends Control<WStaticText>
{
	/**
	 * Script Name   : <b>StaticText</b>
	 * Generated     : <b>11.05.2011 15:37:32</b>
	 * Description   : Functional Test Script
	 * Original Host : WinNT Version 5.1  Build 2600 (S)
	 * 
	 * @since  2011/05/11
	 * @author mariyana.hristova
	 */
	public StaticText(String propertyValue, String propertyName,
			String objClass, TestObject parent, String descriptiveName) {
		super(propertyValue, propertyName, objClass, parent, descriptiveName);
		// TODO Auto-generated constructor stub
	}
	
	public String getText()
	{
		return this.get().getText();
	}

	@Override
	public boolean isEnabled() {
		
		return this.get().isEnabled();
	}

	@Override
	public boolean isExist() {
		return this.get().ensureObjectIsVisible();
	}

	@Override
	public WStaticText get() {
		if(this.isCognosControl())
		{
			TestObject parent = this.getParent();
			this.obj = new WStaticText(parent.getChildren()[0]);
		}
		else
		{
			Regex toSerach = new Regex(this.PropValue(), Regex.MATCH_MULTILINE);
			this.obj = new WStaticText(toSerach,this.PropName(),this.getObjClass(),this.getParent());
		}
		return this.obj;
	}
}

